#ifndef THREAD_H
#define THREAD_H

#include <iostream>
#include <cstdlib>

void*routine(void*arg);

class Thread
{
public:
    Thread();
    ~Thread();

    void start();
    void stop();

    //线程要执行的任务
    virtual void run() = 0;
protected:
    pthread_t th;
    bool exit;
};

#endif // THREAD_H
